package com.yhy;

/**
 * describe:一个顶点类
 *
 * @author helloworldyu
 * @data 2017/11/13
 */
public class Vertex extends BasicElement{
	/**
	 * 是否遍历过
	 */
	private boolean visted=false;

	/**
	 * 父节点,广度优先遍历需要使用的
	 */
	private Vertex parent=null;


	/**
	 * 遍历的时候距离原理的距离
	 */
	private int distance=0;

	public Vertex( int id ){
		super(id);
	}

	public boolean isVisted() {
		return visted;
	}

	public void setVisted(boolean visted) {
		this.visted = visted;
	}

	public Vertex getParent() {
		return parent;
	}

	public void setParent(Vertex parent) {
		this.parent = parent;
	}

	public int getDistance() {
		return distance;
	}

	public void setDistance(int distance) {
		this.distance = distance;
	}

	@Override
	public String toString() {
		return "Vertex{" +
				"visted=" + visted +
				", parent=" + parent +
				", distance=" + distance +
				", id=" + id +
				'}';
	}
}